package com.hyc.myvideo.data.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.hyc.myvideo.ui.base.BaseFragment;

import java.util.ArrayList;


/**
 * 导航适配器
 * @author gyb
 * @version 1.0
 * @created 2017/07/21
 */
public class PlayerAdapter extends FragmentPagerAdapter {
    private ArrayList<BaseFragment> fragments;

    public PlayerAdapter(FragmentManager fm) {
        super(fm);
    }

    public PlayerAdapter(FragmentManager fm, ArrayList<BaseFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public int getItemPosition(Object object) {
        return super.getItemPosition(object);
    }
}